// function getLength(arg: string | any[] | { length: number }) {
//     return arg.length
// }

interface ILength {
    length: number
}
function getLength<T extends ILength>(arg: T) {
    return arg.length
}

getLength('acv')
getLength([1, 2, 3])
getLength({ length: 30 })


type A = { length: number }
function getLength2<T extends A>(arg: T) {
    return arg.length
}
getLength2('acv')
getLength2([1, 2, 3])
getLength2({ length: 30 })

export { }